﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using umbraco.BusinessLogic;
using UComment.Domain;
using umbraco.cms.businesslogic.workflow;
using umbraco.cms.businesslogic.web;

/* 
namespace UComment.Event
{
    
    public class UCommentSampleEventHandlers : ApplicationBase
    {

        public UCommentSampleEventHandlers()
        {
            Comment.CommentCreated += new Comment.CommentCreatedEventHandler(NewComment);
            Comment.CommentSpam += new Comment.CommentSpamEventHandler(SpamComment);
        }


        public void NewComment(Comment sender, EventArgs e)
        {
            foreach(Notification n in Notification.GetNodeNotifications(new Document(sender.ParentNodeId))) {
                
                string email = new User(n.UserId).Email;
                
                umbraco.library.SendMail(
                    new User(0).Email,
                    email,
                    "New Comment",
                    sender.ToString(),
                    false
                );
            }
        }

        public void SpamComment(Comment sender, EventArgs e)
        {

        }
    }
     
} */